/*
 * resfilter.h
 *
 * 		Modified version of: http://www.musicdsp.org/showArchiveComment.php?ArchiveID=29
 *
 * 		Added envelope functionality
 *
 * 		Frequency range:
 * 		Attack section: 	min frequency to max frequency
 * 		Decay section:		max frequency to mid-point of min and max frequencies
 * 		Sustain section:	mid-point of min and max frequencies
 * 		Release section:	mid-point of min and max frequencies to min frequency
 *
 */

#include <voice.h>

#ifndef RESFILTER_H_
#define RESFILTER_H_

#define ATTACK 	0
#define DECAY 	1
#define SUSTAIN 2
#define RELEASE 3

void resFilter_cutoff(float cutoffFreq, float res_lp);
int32_t resFilter(int32_t sampleIn);
void resFilter_freqEnvInit(float attackTime, float decayTime, float releaseTime, float filterMinFreq, float filterMaxFreq);
float resFilter_freqEnvUpdate();
void resFilter_freqEnvRelease();

#endif /* RESFILTER_H_ */
